package rickyGame.ui
{
	import comp.Panel;
	
	import flash.display.DisplayObject;
	
	import rickyGame.ui.pack.Grid;
	import rickyGame.ui.pack.Vessel;

	/**
	 * 物品快捷方式
	 */
	public class Shortcut extends Panel
	{
		public function Shortcut()
		{
			//this.template=IconResource.backGroundSmall;
			this.width=360;
			this.height=36;
			this.tileWidth=34;
			this.titleHeight=34;
			this.paddingLeft=10;
			this.layout="TileLayout";
			this.gap=1;
		}
		
		
		override protected function createChildren():void
		{
			var box:Vessel;
			
			for(var i:int=0;i<10;i++)
			{
				box=new Vessel();
				this.addChild(box);
			}
		}
		
		public function AddVessel(grid:Grid):DisplayObject
		{
			var box:Vessel;
			for(var i:int=0;i<10;i++)
			{
				box=this.getChildAt(i) as Vessel;
				if(!box.isfull)
					return	box.addGrid(grid);
			}
			return null;
		}
	}
}